package com.kotle.baselib.mvvm;

import android.app.Application;
import android.arch.lifecycle.AndroidViewModel;
import android.support.annotation.NonNull;

/**
 * Created by Administrator on 2017/6/28.
 * MVVM模式 所有ViewModel的父类
 * T:对应的Activity
 */

public abstract class BaseViewModel<T extends BaseNetWork> extends AndroidViewModel {
    private T netWork;
    public BaseViewModel(@NonNull Application application) {
        super(application);
        netWork = createNetWork();
    }

    public abstract T createNetWork();

    protected T getNetWork() {
        return netWork;
    }
}
